﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Accessor
{
    public class Library
    {
        public Library(int serialnumber, string name, double price)
        {
            SerialNumber = serialnumber;
            Name = name;
            Price = price;
        }

        public int _serialNumber;
        public  string _name;
        public  double _price;

        //图书编号
        public int SerialNumber
        {
            get
            {
                return _serialNumber;
            }
            set
            {
                _serialNumber = value;
            }
        }
        /// <summary>
        /// 图书名称
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
            }
        }
        //图书价格
        public double Price
        {
            get
            {
                return _price;
            }
            set
            {
                if(value>=1 && value<=1000)
                {

                _price = value;

                }
                else
                {

                    _price = 0;

                }

            }
        }

        public void BooksTube()
        {
            Console.WriteLine("图书编号:{0}   图书名字:{1}    图书价格:{2}", this._serialNumber, this._name,this._price);

        }

        public void BooksTubes(int serialnumber, string name, double price)
        {
            _serialNumber = serialnumber;
            _name = name;
            _price = price;
        }
        ~Library()
        {
            Console.WriteLine("图书特价:{0}!!!",Price);
        }

    }
}
